package cn.stylefeng.guns.modular.order.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


/**
 * 订单信息表
 * @author allen
 * @date 2021/4/11 17:18
 * @version 1.0
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "order_info")
public class OrderInfoEntity implements Serializable {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户账号ID
     */
    @TableField(value = "user_account_id")
    private Long userAccountId;

    /**
     * 用户名
     */
    @TableField(value = "username")
    private String username;

    /**
     * 订单编号，随机生成的UUID
     */
    @TableField(value = "order_no")
    private String orderNo;

    /**
     * 订单状态，1：待付款，2：已取消，3：待发货，4：待收货，5：已完成，6：售后中（退货申请待审核），7：交易关闭（退货审核不通过），8：交易中（待寄送退货商品），9：售后中（退货商品待收货），10：售后中（退货待入库），11：（1）售后中（退货已入库），12：交易关闭（完成退款）
     */
    @TableField(value = "order_status")
    private Integer orderStatus;

    /**
     * 收货人
     */
    @TableField(value = "consignee")
    private String consignee;

    /**
     * 收货地址
     */
    @TableField(value = "delivery_address")
    private String deliveryAddress;

    /**
     * 收货人电话号码
     */
    @TableField(value = "consignee_cell_phone_number")
    private String consigneeCellPhoneNumber;

    /**
     * 运费
     */
    @TableField(value = "freight")
    private BigDecimal freight;

    /**
     * 支付方式，1：支付宝，2：微信
     */
    @TableField(value = "pay_type")
    private Integer payType;

    /**
     * 订单总金额
     */
    @TableField(value = "total_amount")
    private BigDecimal totalAmount;

    /**
     * 促销活动折扣金额
     */
    @TableField(value = "discount_amount")
    private BigDecimal discountAmount;

    /**
     * 优惠券抵扣金额
     */
    @TableField(value = "coupon_amount")
    private BigDecimal couponAmount;

    /**
     * 应付金额，订单总金额 - 促销活动折扣金额 - 优惠券抵扣金额 + 运费
     */
    @TableField(value = "payable_amount")
    private BigDecimal payableAmount;

    /**
     * 发票抬头
     */
    @TableField(value = "invoice_title")
    private String invoiceTitle;

    /**
     * 纳税人识别号
     */
    @TableField(value = "taxpayer_id")
    private String taxpayerId;

    /**
     * 订单备注
     */
    @TableField(value = "order_comment")
    private String orderComment;

    /**
     * 是否发表评论，1：发表，0：未发表
     */
    @TableField(value = "is_published_comment")
    private Integer isPublishedComment;

    /**
     * 确认收货时间
     */
    @TableField(value = "confirm_receipt_time")
    private Date confirmReceiptTime;

    /**
     * 创建时间
     */
    @TableField(value = "gmt_create")
    private Date gmtCreate;

    /**
     * 更新时间
     */
    @TableField(value = "gmt_modified")
    private Date gmtModified;

    private static final long serialVersionUID = 1L;

    public static final String COL_ID = "id";

    public static final String COL_USER_ACCOUNT_ID = "user_account_id";

    public static final String COL_USERNAME = "username";

    public static final String COL_ORDER_NO = "order_no";

    public static final String COL_ORDER_STATUS = "order_status";

    public static final String COL_CONSIGNEE = "consignee";

    public static final String COL_DELIVERY_ADDRESS = "delivery_address";

    public static final String COL_CONSIGNEE_CELL_PHONE_NUMBER = "consignee_cell_phone_number";

    public static final String COL_FREIGHT = "freight";

    public static final String COL_PAY_TYPE = "pay_type";

    public static final String COL_TOTAL_AMOUNT = "total_amount";

    public static final String COL_DISCOUNT_AMOUNT = "discount_amount";

    public static final String COL_COUPON_AMOUNT = "coupon_amount";

    public static final String COL_PAYABLE_AMOUNT = "payable_amount";

    public static final String COL_INVOICE_TITLE = "invoice_title";

    public static final String COL_TAXPAYER_ID = "taxpayer_id";

    public static final String COL_ORDER_COMMENT = "order_comment";

    public static final String COL_IS_PUBLISHED_COMMENT = "is_published_comment";

    public static final String COL_CONFIRM_RECEIPT_TIME = "confirm_receipt_time";

    public static final String COL_GMT_CREATE = "gmt_create";

    public static final String COL_GMT_MODIFIED = "gmt_modified";
}